//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.diboot.iam.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.hibernate.validator.constraints.Length;

import jakarta.validation.constraints.NotNull;
import java.time.LocalDate;
import java.time.LocalDateTime;

@TableName("dbt_iam_user")
public class IamUser extends BaseLoginUser {
    private static final long serialVersionUID = -8462352695775599715L;

    @TableField
    private String tenantId;
    @TableField
    private @NotNull(
            message = "组织ID不能为空"
    ) String orgId;
    @TableField
    private @NotNull(
            message = "用户编号不能为空"
    ) @Length(
            max = 20,
            message = "用户编号长度应小于50"
    ) String userNum;
    @TableField
    private @NotNull(
            message = "真实姓名不能为空"
    ) @Length(
            max = 50,
            message = "真实姓名长度应小于50"
    ) String realname;
    @TableField
    private @NotNull(
            message = "性别不能为空"
    ) @Length(
            max = 10,
            message = "性别长度应小于10"
    ) String gender;
    @TableField
    private @Length(
            max = 20,
            message = "手机号长度应小于20"
    ) String mobilePhone;
    @TableField
    private @Length(
            max = 50,
            message = "Email长度应小于50"
    ) String email;
    @JsonFormat(
            pattern = "yyyy-MM-dd"
    )
    @TableField
    private LocalDate birthdate;
    @TableField
    private @NotNull(
            message = "状态不能为空"
    ) @Length(
            max = 10,
            message = "状态长度应小于10"
    ) String status;
    @TableField
    private String avatarUrl;
    @TableField(
            fill = FieldFill.INSERT_UPDATE
    )
    private LocalDateTime updateTime;

    /**
     * 钉钉用户ID
     */
    @TableField
    private String dingUserId;

    public IamUser() {
    }

    public String getDisplayName() {
        return this.realname;
    }

    public String getUserType() {
        return IamUser.class.getSimpleName();
    }

    public String getTenantId() {
        return this.tenantId;
    }

    public String getOrgId() {
        return this.orgId;
    }

    public String getUserNum() {
        return this.userNum;
    }

    public String getRealname() {
        return this.realname;
    }

    public String getGender() {
        return this.gender;
    }

    public String getMobilePhone() {
        return this.mobilePhone;
    }

    public String getEmail() {
        return this.email;
    }

    public LocalDate getBirthdate() {
        return this.birthdate;
    }

    public String getStatus() {
        return this.status;
    }

    public String getAvatarUrl() {
        return this.avatarUrl;
    }

    public LocalDateTime getUpdateTime() {
        return this.updateTime;
    }

    public IamUser setTenantId(final String tenantId) {
        this.tenantId = tenantId;
        return this;
    }

    public IamUser setOrgId(final String orgId) {
        this.orgId = orgId;
        return this;
    }

    public IamUser setUserNum(final String userNum) {
        this.userNum = userNum;
        return this;
    }

    public IamUser setRealname(final String realname) {
        this.realname = realname;
        return this;
    }

    public IamUser setGender(final String gender) {
        this.gender = gender;
        return this;
    }

    public IamUser setMobilePhone(final String mobilePhone) {
        this.mobilePhone = mobilePhone;
        return this;
    }

    public IamUser setEmail(final String email) {
        this.email = email;
        return this;
    }

    @JsonFormat(
            pattern = "yyyy-MM-dd"
    )
    public IamUser setBirthdate(final LocalDate birthdate) {
        this.birthdate = birthdate;
        return this;
    }

    public IamUser setStatus(final String status) {
        this.status = status;
        return this;
    }

    public IamUser setAvatarUrl(final String avatarUrl) {
        this.avatarUrl = avatarUrl;
        return this;
    }

    public IamUser setUpdateTime(final LocalDateTime updateTime) {
        this.updateTime = updateTime;
        return this;
    }

    public String getDingUserId() {
        return dingUserId;
    }

    public void setDingUserId(String dingUserId) {
        this.dingUserId = dingUserId;
    }
}
